﻿namespace Vin.Extension.JwtBearer.Models;

public class JwtOption
{
    /// <summary>
    /// 加密的key（SecretKey必须大于16个,是大于，不是大于等于）
    /// </summary>
    public string SecretKey { get; set; } = null!;

    /// <summary>
    /// token时间（分）
    /// </summary>
    public int TokenExpireTime { get; set; } = 1440;

    /// <summary>
    /// 存储Token的前缀
    /// </summary>
    public string TokenKey { get; set; } = "Authorization:";

    /// <summary>
    /// 开启终端验证
    /// </summary>
    public bool OpenTerminal { get; set; } = true;

    /// <summary>
    /// 存储终端的前缀
    /// </summary>
    public string TerminalKey { get; set; } = "Terminal:";

    /// <summary>
    /// 终端数量
    /// </summary>
    public int TerminalCount { get; set; } = 1;

    /// <summary>
    /// 刷新Token的时间（分）
    /// </summary>
    public string? RefreshTokenSecretKey { get; set; }

    /// <summary>
    /// 刷新Token的时间（分）
    /// </summary>
    public int RefreshTokenExpireTime { get; set; } = 43200; // 30天

    /// <summary>
    /// 刷新Token的存储前缀
    /// </summary>
    public string? RefreshTokenKey { get; set; } = "RefreshToken:";
}